package net.lab1024.sa.admin.module.business.file.controller;

import net.lab1024.sa.admin.module.business.file.domain.form.add.DocmentaaAddForm;
import net.lab1024.sa.admin.module.business.file.domain.form.query.DocmentaaQueryForm;
import net.lab1024.sa.admin.module.business.file.domain.form.update.DocmentaaUpdateForm;
import net.lab1024.sa.admin.module.business.file.domain.vo.DocmentaaVO;
import net.lab1024.sa.admin.module.business.file.service.DocmentaaService;
import net.lab1024.sa.base.common.domain.ValidateList;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import cn.dev33.satoken.annotation.SaCheckPermission;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.common.domain.PageResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 生产订单与机器对应表 Controller
 *
 * @Author AKITA
 * @Date 2025-07-09 15:18:23
 * @Copyright AKITA
 */

@RestController
@Tag(name = "生产订单与机器对应表")
public class DocmentaaController {

    @Resource
    private DocmentaaService docmentaaService;


    @PostMapping("/docmentaa/queryPage")
    public ResponseDTO<PageResult<DocmentaaVO>> queryPage(@RequestBody @Valid DocmentaaQueryForm queryForm) {
        return ResponseDTO.ok(docmentaaService.queryPage(queryForm));
    }


    @PostMapping("/docmentaa/add")
    public ResponseDTO<String> add(@RequestBody @Valid DocmentaaAddForm addForm) {
        return docmentaaService.add(addForm);
    }


    @PostMapping("/docmentaa/update")
    public ResponseDTO<String> update(@RequestBody @Valid DocmentaaUpdateForm updateForm) {
        return docmentaaService.update(updateForm);
    }


    @PostMapping("/docmentaa/batchDelete")
    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
        return docmentaaService.batchDelete(idList);
    }


    @GetMapping("/docmentaa/delete/{docEntry}")
    public ResponseDTO<String> batchDelete(@PathVariable Long docEntry) {
        return docmentaaService.delete(docEntry);
    }
}
